using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_BaseSchemaTypeMap : EntityTypeConfiguration<t_BaseSchemaType>
    {
        public t_BaseSchemaTypeMap()
        {
            // Primary Key
            this.HasKey(t => t.FTypeID);

            // Properties
            this.Property(t => t.FTypeID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FTypeName)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FSchemaName)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FNameSpaceName)
                .IsRequired()
                .HasMaxLength(255);

            // Table & Column Mappings
            this.ToTable("t_BaseSchemaType");
            this.Property(t => t.FTypeID).HasColumnName("FTypeID");
            this.Property(t => t.FTypeName).HasColumnName("FTypeName");
            this.Property(t => t.FSchemaName).HasColumnName("FSchemaName");
            this.Property(t => t.FNameSpaceName).HasColumnName("FNameSpaceName");
        }
    }
}
